/*
 * @PageName: @物流询价相关接口
 * @Description:
 * @FilePath: /glm_frontend/src/api/logistics.js
 */
import request from '@/utils/request'

// 询价列表
export function inquiryListAPI(params) {
	return request({
		url: '/glm/quotation/list',
		method: 'get',
		params
	})
}

export function quotationDetailAPI(params) {
	return request({
		url: '/glm/quotation/detail',
		method: 'get',
		params
	})
}

// 模糊查询销售订单号
export function searchOrderIdAPI(params) {
	return request({
		url: '/glm/quotation/order',
		method: 'get',
		params
	})
}
// 运输方式列表
export function transportListAPI(params) {
	return request({
		url: '/glm/quotation/transport',
		method: 'get',
		params
	})
}
// 物流公司列表
export function logisticsCompanyListAPI(params) {
	return request({
		url: '/glm/quotation/company',
		method: 'get',
		params
	})
}
// 亚马逊仓库代码列表
export function amazonCodeListAPI() {
	return request({
		url: '/glm/quotation/amazonCode',
		method: 'get'
	})
}
// 询价提交
export function addQuotationAPI(data) {
	return request({
		url: '/glm/quotation/add',
		method: 'post',
		data
	})
}
// 终止询价
export function endQuotationAPI(params) {
	return request({
		url: `/glm/quotation/end`,
		method: 'get',
		params
	})
}
// 修改询价
export function editQuotationAPI(data) {
	return request({
		url: `/glm/quotation/change`,
		method: 'put',
		data
	})
}
// 接受报价
export function quotaReceive(params) {
	return request({
		url: '/glm/quotation/receive',
		method: 'get',
		params
	})
}

/* ===========================  常用地址管理 ============================= */
// 获取常用地址列表
export function getCommonAddressesAPI(params) {
	return request({
		url: '/glm/quotation/commonAddresses',
		method: 'get',
		params
	})
}
// 获取当前默认地址
export function getDefaultAddressesAPI(params) {
	return request({
		url: '/glm/quotation/defaultAddresses',
		method: 'get',
		params
	})
}
// 更改默认地址
export function changeDefaultAddressesAPI(params) {
	return request({
		url: `/glm/quotation/changeDefaultAddresses`,
		method: 'put',
		params
	})
}
// 新增常用地址
export function addAddressesAPI(data) {
	return request({
		url: '/glm/quotation/addAddresses',
		method: 'post',
		data
	})
}
// 修改常用地址
export function changeAddressesAPI(data) {
	return request({
		url: `/glm/quotation/changeAddresses`,
		method: 'put',
		data
	})
}
// 删除地址
export function deleteAddressesAPI(id) {
	return request({
		url: `/glm/quotation/deleteAddresses?addressIds=${id}`,
		method: 'delete'
	})
}
